<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" data-rule="required" name="row[name]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Condition')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-condition_ids" placeholder="不选择时表示不限制" data-source="shop/coupon_condition/index" class="form-control selectpage" name="row[condition_ids]" type="text" data-multiple="true" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Result')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-result" class="form-control selectpicker" data-rule="required" name="row[result]">
                {foreach name="resultList" item="vo"}
                <option value="{$key}" {in name="key" value="" }selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8" style="display: flex;align-items: center;">
            <div>订单满&nbsp;</div>
            <div><input class="form-control" name="row[result_data][money]" type="number"></div>
            <div>&nbsp;元，<span id="text-a">打</span>&nbsp;</div>
            <div><input class="form-control" name="row[result_data][number]" type="number"></div>
            <div style="margin-left: 5px;" id="text-b">折</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Give_num')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-give_num" data-rule="required" class="form-control" name="row[give_num]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Allow_num')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-allow_num" data-rule="required" class="form-control" name="row[allow_num]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_open')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-is_open" class="form-control selectpicker" name="row[is_open]">
                {foreach name="isOpenList" item="vo"}
                <option value="{$key}" {in name="key" value="1" }selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_private')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
            {foreach name="IsPrivateList" item="vo"}
            <label for="row[is_private]-{$key}"><input id="row[is_private]-{$key}" name="row[is_private]" type="radio" value="{$key}" {in name="key" value="no"}checked{/in} /> {$vo}</label>
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Receive_times')}:</label>
        <div class="col-xs-12 col-sm-8 receive_times">
            <input id="c-receive_times" class="form-control datetimerange" data-use-current="true" name="row[receive_times]" autocomplete="off" type="text" value="{:date('Y-m-d 00:00:00')} - {:date('Y-m-d 23:59:00')}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Mode')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
            {foreach name="modeList" item="vo"}
            <label for="row[mode]-{$key}"><input id="row[mode]-{$key}" name="row[mode]" class="modes" type="radio" value="{$key}" {in name="key" value="dates"}checked{/in} /> {$vo}</label>
            {/foreach}
            </div>

        </div>
    </div>
    <div id="modetpl">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Use_times')}:</label>
            <div class="col-xs-12 col-sm-8 use_times">
                <input id="c-use_times" class="form-control datetimerange"
                    data-use-current="true" name="row[use_times]" autocomplete="off" type="text" value="{:date('Y-m-d 00:00:00')} - {:date('Y-m-d 23:59:00')}">
            </div>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
{include file="shop/coupon/modetpl" /}
